package com.itheima.controller;

import com.itheima.aspect.annotation.Log;
import com.itheima.enums.BusinessType;
import com.itheima.enums.OperatorType;
import com.itheima.service.SysLogService;
import com.itheima.vo.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @version 1.0
 * @description 说明
 * @package com.itheima.controller
 */
@RestController
@RequestMapping("/t")
public class MyController {

    @Resource
    private SysLogService sysLogService;

    @Log(title = "商品查询", businessType= BusinessType.OTHER, operatorType= OperatorType.OTHER,isSaveRequestData = true)
    @GetMapping("findById/{id}")
    public R getById(@PathVariable(value = "id") int id){
        //sysLogService.updateBatchById()
        return R.okMsg("成功" + id);
    }

    @GetMapping("deleteById/{id}")
    @Log(title = "商品删除", businessType= BusinessType.OTHER, operatorType= OperatorType.OTHER,isSaveRequestData = true)
    public String deleteById(@PathVariable(value = "id") int id){
        return "成功" + id;
    }

}
